package com.codechuan.didi_hack.thread;


import android.util.Log;

import com.codechuan.didi_hack.common.Constant;
import com.codechuan.didi_hack.utils.DiDiHttpUtil;

import java.io.IOException;
import java.util.Objects;

/**
 * @Deprecated 获取订单线程
 */
public class GetAnOrderThread implements Runnable {
    private int size = Constant.token.size();

    @Override
    public void run() {
        while (Constant.isStart) {
            if (size == Constant.token.size())
                size = 0;
            try {
                DiDiHttpUtil.getACrossCityOrderInTheLobby(size);
            } catch (IOException e) {
                Log.i("获取订单错误消息", Objects.requireNonNull(e.getMessage()));
            }
            try {
                Thread.sleep(800);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            size++;
        }
    }
}
